package com.zsc.wxm.ysh.anjo.service.base.enums.resources;

import lombok.Getter;

/**
 * 描述：房源状态：1待审核、2审核通过、3空置中、4已出租
 *
 * @author playmaker
 * @since 2021/2/13 11:28
 */
@Getter
public enum HouseStatus {
    /**
     * 状态
     */
    PENDING(1, "待审核"),
    PASSED(2, "审核通过"),
    AVAILABLE(3, "空置中"),
    UNAVAILABLE(4, "已出租"),
    NOT_PASSED(5, "审核不通过")
    ;

    /**
     * 值
     */
    private int value;

    /**
     * 描述
     */
    private String desc;

    HouseStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getEnumDesc(int value) {
        for (HouseStatus status : HouseStatus.values()) {
            if (status.getValue() == value) {
                return status.getDesc();
            }
        }
        return "";
    }
}
